import { connect } from 'react-redux'
import Orders from '../components/Orders'
import {getMyOrders} from '../actions'

const mapStateToProps = (state, ownProps) => {
  return {
    orders: state.orders.data,
    page: 1
  }
}

const mapDispatchToProps = (dispatch, ownProps) => {
  return {
    getOrders: (page) => {
      console.log('ownProps: ', ownProps)
      dispatch(getMyOrders())
    }
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(Orders)
